

let path = require('path');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let webpack= require('webpack');
let webpackMerge = require('webpack-merge');
let ExtractTextPlugin = require("extract-text-webpack-plugin");

let devhot = require('./webpack.devhot');
let dev = require('./webpack.dev');
let prod = require('./webpack.prod');

const NODE_ENV = process.env.NODE_ENV; 
//开发环境构建，启动服务，不压缩代码
const ENV_DEV_SERVER = NODE_ENV === 'dev';


let tmp ;
if(NODE_ENV == 'dev'){
    tmp = dev;
}
else if(NODE_ENV == 'devhot'){
    tmp = devhot;
}
else if(NODE_ENV == 'production'){
    tmp = prod;
}
module.exports =webpackMerge(tmp,{
    plugins:[new webpack.optimize.CommonsChunkPlugin({
        name:'common',
        chunks:['index']
      })]
})